<template>
  <div
    class="app-basement navg"
    :style="`background: url('${
      settingBanner ? settingBanner : src
    }') no-repeat;`"
  >
    <div class="content-basement navg-bander" v-if="!settingBanner">
      <p>{{ qyname.split("/")[0] }}</p>
      <p v-if="qyname.includes('/')">{{ qyname.split("/")[1] }}</p>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      qyname: "",
      src: require("@/assets/header.png"),
      settingBanner: "",
    };
  },
  computed: {
    ...mapGetters(["init"]),
  },
  created() {
    this.qyname = this.init.alias;
    let obj = JSON.parse(this.init.setting);

    if (obj.bannerOfPc != "") {
      this.settingBanner = obj.bannerOfPc;
    }

    //   if (this.platform("taihua")) {
    //   this.src = require("@/assets/taihuaheader.png");
    // }
    // if (this.platform("xingye")) {
    //   this.src = require("@/assets/xingye.png");
    // }
  },
};
</script>

<style lang="scss" scoped>
.navg {
  height: 400px;
  background: url("~@/assets/header.jpg") no-repeat;
  background-size: 100%;
  background-position: center !important;
  display: flex;
  align-items: center;
  justify-content: center;
  .navg-bander {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    p {
      margin: 0;
      color: #fff;
      font-size: 40px;
      display: inline-block;
      letter-spacing: 12px;
      // height:140px;
    }
  }
}
</style>